"hamcrest 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "libgit2-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.48 (registry+https://github.com/rust-lang/crates.io-index)",
dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "libgit2-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libgit2-sys"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cmake 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
Ok((packages, resolved_with_overrides))
}
-fn validate_target(package: &Package,
- name: &str,
- kind: TargetKind,
- kind_str: &str) -> CargoResult<()> {
- let target = package.targets().iter().find(|t: &&Target| {
- t.name() == name && *t.kind() == kind
- });
- if target.is_none() {
- let suggestion = package.find_closest_target(name, kind);
- match suggestion {
- Some(s) => bail!("no {} target named `{}`\n\nDid you mean `{}`?",
- kind_str, name, s.name()),
- None => bail!("no {} target named `{}`", kind_str, name),
- }
- }
-
- Ok(())
-}
-
pub fn compile_pkg<'a>(root_package: &Package,
source: Option<Box<Source + 'a>>,
options: &CompileOptions<'a>)
bail!("jobs must be at least 1")
}
- if let CompileFilter::Only{bins, examples, ..} = *filter {
- for bin in bins {
- try!(validate_target(root_package, bin, TargetKind::Bin, "bin"));
- }
-
- for example in examples {
- try!(validate_target(root_package, example, TargetKind::Example, "example"));
- }
- }
-
let (packages, resolve_with_overrides) = {
try!(resolve_dependencies(root_package, config, source, features,
no_default_features))
});
let t = match target {
Some(t) => t,
- None => bail!("no {} target named `{}`", desc, name),
+ None => {
+ let suggestion = pkg.find_closest_target(name, kind);
+ match suggestion {
+ Some(s) => bail!("no {} target named `{}`\n\nDid you mean `{}`?",
+ desc, name, s.name()),
+ None => bail!("no {} target named `{}`", desc, name),
+ }
+ }
};
debug!("found {} `{}`", desc, name);
targets.push((t, profile));